package Model;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import Entity.Customer;
import S2.server.ConnectionManage;

public class ContactCusModel {

	private static Connection conn = ConnectionManage.getInstance()
			.getConnection();
	
	public static boolean addContactCus(String customerId,String employeeId, String date, 
			String startTime, String endTime, String desc ) throws SQLException 
	{
		
		String sql = "insert into contact_customer (customer_id, employee_id,"
				
				 +"date, start_time, end_time, description" ) "+" values (?, ?, ?, ?)";
		ResultSet rs = null;
		Customer bean =  new Customer();


		try (PreparedStatement stmt = conn.prepareStatement(sql);) {
			stmt.setString(1, Id);
			stmt.setString(2, name);
			stmt.setString(3, birthDate);
			stmt.setString(4, rate);
		
			boolean res = stmt.execute();
			return !res;

	

		} catch (SQLException e) {
			System.err.println(e.getMessage());
			return false;
		} finally {
			if (rs != null) {
				rs.close();
			}
		}
//		return true;
	}
	
	
}
